﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Traceability.App.Api.Application.Command.Detail.DeepProcessing;
using Traceability.App.ErrorCount;
using Traceability.App.Model.DeepProcessing;

namespace Traceability.App.Api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class DeepProcessingController : ControllerBase
    {
        IMediator mediator;

        public DeepProcessingController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        [HttpPost]
        public Task<ApiResult<int>> AddDeepProcessing(AddDeepProcessingCommand request)
        {
            return mediator.Send(request);
        }
        [HttpPost]
        public Task<ApiResult<int>> AddDeepProcessingCompany(AddDeepProcessingCompanyCommand request)
        {
            return mediator.Send(request);
        }
        [HttpGet]
        public Task<ApiResult<DeepProcessingCompanyModel>> GetDeepProcessingCompany([FromQuery]GetDeepProcessingCompanyCommand request)
        {
            return mediator.Send(request);
        }
        [HttpGet]
        public Task<ApiResult<DeepProcessingModel>> GetDeepProcessing([FromQuery]GetDeepProcessingCommand request)
        {
            return mediator.Send(request);
        }
        [HttpPost]
        public Task<ApiResult<int>> AddVendor(AddVendorCommand request)
        {
            return mediator.Send(request);
        }
        [HttpGet]
        public Task<ApiResult<DeepVendorModel>> GetVendor([FromQuery]GetVendorCommand request)
        {
            return mediator.Send(request);
        }
    }
}
